﻿using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category6
{
  public class MT606 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagDefinition U0002;
    private static SwiftTagSubItemDefinition U0003;
    private static SwiftTagDefinition U0004;
    private static SwiftTagSubItemDefinition U0005;
    private static SwiftTagDefinition U0006;
    private static SwiftTagSubItemDefinition U0007;
    private static SwiftTagDefinition U0008;
    private static SwiftTagSubItemDefinition U000E;
    private static SwiftTagDefinition U000F;
    private static SwiftTagDefinition U0010;
    private static SwiftTagSubItemDefinition U0011;
    private static SwiftTagDefinition U0012;
    private static SwiftTagSubItemDefinition U0013;
    private static SwiftTagSubItemDefinition U0014;
    private static SwiftTagChoiceDefinition U0015;
    private static SwiftTagDefinition U0016;
    private static SwiftTagSubItemDefinition U0017;
    private static SwiftTagSubItemDefinition U0018;
    private static SwiftTagDefinition U0019;
    private static SwiftTagSubItemDefinition U001A;
    private static SwiftTagSubItemDefinition U001B;
    private static SwiftTagChoiceDefinition U001C;
    private static SwiftTagDefinition U001D;
    private static SwiftTagSubItemDefinition U001E;
    private static SwiftTagSubItemDefinition U001F;
    private static SwiftTagDefinition U007F;
    private static SwiftTagSubItemDefinition U0080;
    private static SwiftTagSubItemDefinition U0081;
    private static SwiftTagChoiceDefinition U0082;
    private static SwiftTagDefinition U0083;
    private static SwiftTagSubItemDefinition U0084;
    private static SwiftTagSubItemDefinition U0086;
    private static SwiftTagDefinition U0087;
    private static SwiftTagSubItemDefinition U0088;
    private static SwiftTagSubItemDefinition U0089;
    private static SwiftTagDefinition U008A;

    [Description("Transaction Reference Number")]
    public Tag20 TransactionReferenceNumber_20
    {
      get
      {
        return new Tag20((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U0002);
      }
    }

    [Description("Transaction Reference Number")]
    public Tag20 Tag20_TransactionReferenceNumber
    {
      get
      {
        return this.TransactionReferenceNumber_20;
      }
    }

    [Description("Related Reference")]
    public Tag21 RelatedReference_21
    {
      get
      {
        return new Tag21((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U0004);
      }
    }

    [Description("Related Reference")]
    public Tag21 Tag21_RelatedReference
    {
      get
      {
        return this.RelatedReference_21;
      }
    }

    [Description("Identification of the Commodity and the Commodity Account")]
    public Tag26C IdentificationOfTheMetalAndTheMetalAccount_26C
    {
      get
      {
        return new Tag26C((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U0006);
      }
    }

    [Description("Identification of the Commodity and the Commodity Account")]
    public Tag26C Tag26C_IdentificationOfTheMetalAndTheMetalAccount
    {
      get
      {
        return this.IdentificationOfTheMetalAndTheMetalAccount_26C;
      }
    }

    [Description("Further Account Identification")]
    public Tag25 FurtherAccountIdentification_25
    {
      get
      {
        return new Tag25((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U0008);
      }
    }

    [Description("Further Account Identification")]
    public Tag25 Tag25_FurtherAccountIdentification
    {
      get
      {
        return this.FurtherAccountIdentification_25;
      }
    }

    [Description("Certificate Number(s) and/or Bar Number(s)")]
    public Tag26D CertificateNumberAndOrBarNumber_26D
    {
      get
      {
        return new Tag26D((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U000F);
      }
    }

    [Description("Certificate Number(s) and/or Bar Number(s)")]
    public Tag26D Tag26D_CertificateNumberAndOrBarNumber
    {
      get
      {
        return this.CertificateNumberAndOrBarNumber_26D;
      }
    }

    [Description("Value Date")]
    public Tag30 ValueDate_30
    {
      get
      {
        return new Tag30((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U0010);
      }
    }

    [Description("Value Date")]
    public Tag30 Tag30_ValueDate
    {
      get
      {
        return this.ValueDate_30;
      }
    }

    [Description("Quantity of the Commodity")]
    public Tag32F QuantityOfTheMetal_32F
    {
      get
      {
        return new Tag32F((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U0012);
      }
    }

    [Description("Quantity of the Commodity")]
    public Tag32F Tag32F_QuantityOfTheMetal
    {
      get
      {
        return this.QuantityOfTheMetal_32F;
      }
    }

    [Description("Instructing Party")]
    public Tag82A InstructingParty_82A
    {
      get
      {
        return new Tag82A((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U0016);
      }
    }

    [Description("Instructing Party")]
    public Tag82A Tag82A_InstructingParty
    {
      get
      {
        return this.InstructingParty_82A;
      }
    }

    [Description("Instructing Party")]
    public Tag82D InstructingParty_82D
    {
      get
      {
        return new Tag82D((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U0019);
      }
    }

    [Description("Instructing Party")]
    public Tag82D Tag82D_InstructingParty
    {
      get
      {
        return this.InstructingParty_82D;
      }
    }

    [Description("Receiver of the Commodity")]
    public Tag87A ReceiverOfTheMetal_87A
    {
      get
      {
        return new Tag87A((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U001D);
      }
    }

    [Description("Receiver of the Commodity")]
    public Tag87A Tag87A_ReceiverOfTheMetal
    {
      get
      {
        return this.ReceiverOfTheMetal_87A;
      }
    }

    [Description("Receiver of the Commodity")]
    public Tag87D ReceiverOfTheMetal_87D
    {
      get
      {
        return new Tag87D((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U007F);
      }
    }

    [Description("Receiver of the Commodity")]
    public Tag87D Tag87D_ReceiverOfTheMetal
    {
      get
      {
        return this.ReceiverOfTheMetal_87D;
      }
    }

    [Description("Beneficiary of the Commodity")]
    public Tag88A BeneficiaryOfTheMetal_88A
    {
      get
      {
        return new Tag88A((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U0083);
      }
    }

    [Description("Beneficiary of the Commodity")]
    public Tag88A Tag88A_BeneficiaryOfTheMetal
    {
      get
      {
        return this.BeneficiaryOfTheMetal_88A;
      }
    }

    [Description("Beneficiary of the Commodity")]
    public MT606.Tag88D BeneficiaryOfTheMetal_88D
    {
      get
      {
        return new MT606.Tag88D((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U0087);
      }
    }

    [Description("Beneficiary of the Commodity")]
    public MT606.Tag88D Tag88D_BeneficiaryOfTheMetal
    {
      get
      {
        return this.BeneficiaryOfTheMetal_88D;
      }
    }

    [Description("Sender to Receiver Information")]
    public Tag72 SenderToReceiverInformation_2_72
    {
      get
      {
        return new Tag72((SwiftElement) this, 0, (SwiftDefinitionElement) MT606.U008A);
      }
    }

    [Description("Sender to Receiver Information")]
    public Tag72 Tag72_SenderToReceiverInformation_2
    {
      get
      {
        return this.SenderToReceiverInformation_2_72;
      }
    }

    public MT606()
      : base(true)
    {
    }

    public MT606(SwiftMessage message)
      : base(message)
    {
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MT606.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MT606.MessageDefinition = new SwiftMessageDefinition("MT606", "Commodity Debit Advice");
      MT606.U0002 = new SwiftTagDefinition("TransactionReferenceNumber_20", "Transaction Reference Number");
      MT606.U0002.TagName = ":20:";
      MT606.U0003 = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT606.U0002.Elements.Add((SwiftDefinitionElement) MT606.U0003);
      MT606.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT606.U0002);
      MT606.U0004 = new SwiftTagDefinition("RelatedReference_21", "Related Reference");
      MT606.U0004.TagName = ":21:";
      MT606.U0005 = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT606.U0004.Elements.Add((SwiftDefinitionElement) MT606.U0005);
      MT606.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT606.U0004);
      MT606.U0006 = new SwiftTagDefinition("IdentificationOfTheMetalAndTheMetalAccount_26C", "Identification of the Commodity and the Commodity Account");
      MT606.U0006.TagName = ":26C:";
      MT606.U0007 = new SwiftTagSubItemDefinition("IdentificationOfTheMetal", "Identification Of The Commodity");
      MT606.U0006.Elements.Add((SwiftDefinitionElement) MT606.U0007);
      MT606.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT606.U0006);
      MT606.U0008 = new SwiftTagDefinition("FurtherAccountIdentification_25", "Further Account Identification");
      MT606.U0008.TagName = ":25:";
      MT606.U0008.Mandatory = false;
      MT606.U000E = new SwiftTagSubItemDefinition("FurtherAccountIdentification", "Further AccountIdentification");
      MT606.U0008.Elements.Add((SwiftDefinitionElement) MT606.U000E);
      MT606.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT606.U0008);
      MT606.U000F = new SwiftTagDefinition("CertificateNumberAndOrBarNumber_26D", "Certificate Number(s) and/or Bar Number(s)");
      MT606.U000F.TagName = ":26D:";
      MT606.U000F.Mandatory = false;
      MT606.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT606.U000F);
      MT606.U0010 = new SwiftTagDefinition("ValueDate_30", "Value Date");
      MT606.U0010.TagName = ":30:";
      MT606.U0011 = new SwiftTagSubItemDefinition("Date", "Date");
      MT606.U0010.Elements.Add((SwiftDefinitionElement) MT606.U0011);
      MT606.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT606.U0010);
      MT606.U0012 = new SwiftTagDefinition("QuantityOfTheMetal_32F", "Quantity of the Commodity");
      MT606.U0012.TagName = ":32F:";
      MT606.U0013 = new SwiftTagSubItemDefinition("Unit", "Unit");
      MT606.U0012.Elements.Add((SwiftDefinitionElement) MT606.U0013);
      MT606.U0014 = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT606.U0012.Elements.Add((SwiftDefinitionElement) MT606.U0014);
      MT606.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT606.U0012);
      MT606.U0015 = new SwiftTagChoiceDefinition("Choice", "");
      MT606.U0015.Mandatory = false;
      MT606.U0015.Multiple = true;
      MT606.U0016 = new SwiftTagDefinition("InstructingParty_82A", "Instructing Party");
      MT606.U0016.TagName = ":82A:";
      MT606.U0017 = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT606.U0017.Mandatory = false;
      MT606.U0016.Elements.Add((SwiftDefinitionElement) MT606.U0017);
      MT606.U0018 = new SwiftTagSubItemDefinition("BankIdentifierCode", "Bank Identifier Code");
      MT606.U0016.Elements.Add((SwiftDefinitionElement) MT606.U0018);
      MT606.U0015.Elements.Add((SwiftDefinitionElement) MT606.U0016);
      MT606.U0019 = new SwiftTagDefinition("InstructingParty_82D", "Instructing Party");
      MT606.U0019.TagName = ":82D:";
      MT606.U001A = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT606.U001A.Mandatory = false;
      MT606.U0019.Elements.Add((SwiftDefinitionElement) MT606.U001A);
      MT606.U001B = new SwiftTagSubItemDefinition("NameAndAddress", "NameAndAddress");
      MT606.U0019.Elements.Add((SwiftDefinitionElement) MT606.U001B);
      MT606.U0015.Elements.Add((SwiftDefinitionElement) MT606.U0019);
      MT606.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT606.U0015);
      MT606.U001C = new SwiftTagChoiceDefinition("Choice", "");
      MT606.U001C.Mandatory = false;
      MT606.U001C.Multiple = true;
      MT606.U001D = new SwiftTagDefinition("ReceiverOfTheMetal_87A", "Receiver of the Commodity");
      MT606.U001D.TagName = ":87A:";
      MT606.U001E = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT606.U001E.Mandatory = false;
      MT606.U001D.Elements.Add((SwiftDefinitionElement) MT606.U001E);
      MT606.U001F = new SwiftTagSubItemDefinition("BankIdentifierCode", "Bank Identifier Code");
      MT606.U001D.Elements.Add((SwiftDefinitionElement) MT606.U001F);
      MT606.U001C.Elements.Add((SwiftDefinitionElement) MT606.U001D);
      MT606.U007F = new SwiftTagDefinition("ReceiverOfTheMetal_87D", "Receiver of the Commodity");
      MT606.U007F.TagName = ":87D:";
      MT606.U0080 = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT606.U0080.Mandatory = false;
      MT606.U007F.Elements.Add((SwiftDefinitionElement) MT606.U0080);
      MT606.U0081 = new SwiftTagSubItemDefinition("NameAndAddress", "NameAndAddress");
      MT606.U007F.Elements.Add((SwiftDefinitionElement) MT606.U0081);
      MT606.U001C.Elements.Add((SwiftDefinitionElement) MT606.U007F);
      MT606.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT606.U001C);
      MT606.U0082 = new SwiftTagChoiceDefinition("Choice", "");
      MT606.U0082.Mandatory = false;
      MT606.U0082.Multiple = true;
      MT606.U0083 = new SwiftTagDefinition("BeneficiaryOfTheMetal_88A", "Beneficiary of the Commodity");
      MT606.U0083.TagName = ":88A:";
      MT606.U0084 = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT606.U0084.Mandatory = false;
      MT606.U0083.Elements.Add((SwiftDefinitionElement) MT606.U0084);
      MT606.U0086 = new SwiftTagSubItemDefinition("BankIdentifierCode", "Bank Identifier Code");
      MT606.U0083.Elements.Add((SwiftDefinitionElement) MT606.U0086);
      MT606.U0082.Elements.Add((SwiftDefinitionElement) MT606.U0083);
      MT606.U0087 = new SwiftTagDefinition("BeneficiaryOfTheMetal_88D", "Beneficiary of the Commodity");
      MT606.U0087.TagName = ":88D:";
      MT606.U0088 = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT606.U0088.Mandatory = false;
      MT606.U0087.Elements.Add((SwiftDefinitionElement) MT606.U0088);
      MT606.U0089 = new SwiftTagSubItemDefinition("NameAndAddress", "NameAndAddress");
      MT606.U0087.Elements.Add((SwiftDefinitionElement) MT606.U0089);
      MT606.U0082.Elements.Add((SwiftDefinitionElement) MT606.U0087);
      MT606.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT606.U0082);
      MT606.U008A = new SwiftTagDefinition("SenderToReceiverInformation_2_72", "Sender to Receiver Information");
      MT606.U008A.TagName = ":72:";
      MT606.U008A.Mandatory = false;
      MT606.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT606.U008A);
    }

    public class Tag88D : SwiftTagWrapper
    {
      public string Value
      {
        get
        {
          return this.GetValue();
        }
        set
        {
          this.SetValue("88D", value);
        }
      }

      internal Tag88D(SwiftElement parent, int index, SwiftDefinitionElement definition)
        : base(parent, index, definition)
      {
      }
    }
  }
}
